import request from '@/config/axios'

// 流量计 VO
export interface FlowmeterVO {
  id: number // id
  name: string // 流量计名称
  model: string // 型号
  serialNumber: string // 序列号
  minFlow: string // 流量最小值
  maxFlow: string // 流量最大值
}

// 流量计 API
export const FlowmeterApi = {
  // 查询流量计分页
  getFlowmeterPage: async (params: any) => {
    return await request.get({ url: `/system/flowmeter/page`, params })
  },

  // 查询流量计详情
  getFlowmeter: async (id: number) => {
    return await request.get({ url: `/system/flowmeter/get?id=` + id })
  },

  // 新增流量计
  createFlowmeter: async (data: FlowmeterVO) => {
    return await request.post({ url: `/system/flowmeter/create`, data })
  },

  // 修改流量计
  updateFlowmeter: async (data: FlowmeterVO) => {
    return await request.put({ url: `/system/flowmeter/update`, data })
  },

  // 删除流量计
  deleteFlowmeter: async (id: number) => {
    return await request.delete({ url: `/system/flowmeter/delete?id=` + id })
  },

  // 导出流量计 Excel
  exportFlowmeter: async (params) => {
    return await request.download({ url: `/system/flowmeter/export-excel`, params })
  },
}